package com.zjp;

import cn.hutool.core.util.StrUtil;
import com.zjp.common.core.config.OssConfig;
import com.zjp.common.core.properties.MyProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;

@SpringBootApplication
@MapperScan("com.zjp.common")
public class ProductApplication implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(ProductApplication.class, args);
    }

    @Autowired
    Environment environment;

    public String getPort() {
        StrUtil.split("", StrUtil.COMMA);
        return environment.getProperty("local.server.port");

    }

    @Autowired
    OssConfig ossConfig;
    @Autowired
    MyProperties myProperties;
    @Override
    public void run(String... args) throws Exception {
        System.out.println("端口--" + getPort());
     /*   Console.error(ossConfig);
        Console.error(myProperties);*/
    }
}
